'use strict';

const Controller = require('egg').Controller;

class PageController extends Controller {
  async about() {
    await this.ctx.renderX('static/about.nj', { pageTitle: '关于我们' });
  }

  // FAQ
  async faq() {
    await this.ctx.renderX('static/faq.nj', { pageTitle: 'FAQ' });
  }

  async getstart() {
    await this.ctx.renderX('static/getstart.nj', { pageTitle: 'Node.js 新手入门' });
  }

  async robots() {
    this.ctx.type = 'text';
    this.ctx.body = `User-agent: *
Disallow: /
`;
  }

  async api() {
    await this.ctx.renderX('static/api.nj', { pageTitle: 'API' });
  }

}

module.exports = PageController;
